package santeclair.referentiel.optique.model;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import santeclair.lunar.framework.annotation.Code;
import santeclair.lunar.framework.annotation.HashCodeEquals;
import santeclair.lunar.framework.annotation.ToString;
import santeclair.lunar.framework.util.EqualsUtils;
import santeclair.lunar.framework.util.HashCodeUtils;
import santeclair.lunar.framework.util.ToStringUtils;
import santeclair.referentiel.optique.config.Constant;

@Entity
@Table(name = "tr_type_traitement_verre", catalog = Constant.SCHEMA_NAME, uniqueConstraints = @UniqueConstraint(columnNames = "code_type_traitement_verre"))
public class TypeTraitementVerre implements java.io.Serializable {

    private static final long serialVersionUID = 2799773140139087926L;

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "identifiant_type_traitement_verre", unique = true, nullable = false)
    @HashCodeEquals
    @ToString
    private Integer identifiantTypeTraitementVerre;

    @Code
    @Column(name = "code_type_traitement_verre", unique = true, nullable = false, length = 10)
    @HashCodeEquals
    @ToString
    private String codeTypeTraitementVerre;

    @Column(name = "code_opto10_type_traitement_verre", unique = false, nullable = false, length = 50)
    @HashCodeEquals
    @ToString
    private String codeOpto10TypeTraitementVerre;

    @Column(name = "libelle_type_traitement_verre", nullable = false)
    @HashCodeEquals
    @ToString
    private String libelleTypeTraitementVerre;

    public TypeTraitementVerre() {
    }

    public Integer getIdentifiant() {
        return this.identifiantTypeTraitementVerre;
    }

    public void setIdentifiant(Integer identifiantTypeTraitementVerre) {
        this.identifiantTypeTraitementVerre = identifiantTypeTraitementVerre;
    }

    public String getCode() {
        return this.codeTypeTraitementVerre;
    }

    public void setCode(String codeTypeTraitementVerre) {
        this.codeTypeTraitementVerre = codeTypeTraitementVerre;
    }

    public String getCodeOpto10() {
        return this.codeOpto10TypeTraitementVerre;
    }

    public void setCodeOpto10(String codeOpto10TypeTraitementVerre) {
        this.codeOpto10TypeTraitementVerre = codeOpto10TypeTraitementVerre;
    }

    public String getLibelle() {
        return this.libelleTypeTraitementVerre;
    }

    public void setLibelle(String libelleTypeTraitementVerre) {
        this.libelleTypeTraitementVerre = libelleTypeTraitementVerre;
    }

    @Override
    public String toString() {
        return ToStringUtils.toString(this);
    }

    @Override
    public int hashCode() {
        return HashCodeUtils.hashCode(this);
    }

    @Override
    public boolean equals(Object obj) {
        return EqualsUtils.isEqual(this, obj);
    }
}
